package Date;

import java.util.Date;

public class Test {
    public static void main(String[] args) {
        Date d = new Date();
        //当前时间
        System.out.println(d);


        //获取当前的时间毫秒值
        System.out.println(d.getTime());

        //把时间毫秒转换成日期
        long t = d.getTime() + 2000;
        System.out.println(new Date(t));


        //修改Date对象的时间，setTime
        Date d2 = new Date();
        d2.setTime(t);
        System.out.println(d2);
    }
}
